home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dr. Windows 3
/
dr win3.zip
/
dr win3
/
PROGRAMR
/
LB09D.ZIP
/
FACTORIL.BAS
< prev
next >
Wrap
BASIC Source File
|
1992-01-27
|
434b
|
26 lines
'this program computes a factorial for a keyboard entered
'number and displays the result
INPUT"Please enter a number>"; entry
result = 1
[recurringLoop]
counter = counter + 1
IF counter > entry THEN [skip]
result = result * counter
GOSUB [recurringLoop]
[skip]
entry = entry - 1
IF entry = 1 THEN [end]
RETURN
[end]
PRINT"The factorial is: "; result